package com.example.app.components


import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.RangeSlider
import androidx.compose.material.Slider
import androidx.compose.runtime.*
import androidx.compose.ui.tooling.preview.Preview

@OptIn(ExperimentalMaterialApi::class)
@Composable
fun SliderStamp() {
    // 可拖动进度条
//    var value by remember {
//        mutableStateOf(0.5f)
//    }
    // steps进度条分为四段
    // valueRange值范围
//    Slider(
//        value = value,
//        onValueChange = {
//            value = it
//        },
//        valueRange = 0f..100f,
//        steps = 4
//    )
    var value by remember {
        mutableStateOf(0.5f..1f)
    }
    // 可选择范围的进度条
    // 默认情况下的取值范围是0-1
    RangeSlider(values = value, onValueChange = {
        value = it
    })
}

@Preview
@Composable
fun SliderStampPreview() {
    SliderStamp()
}

